﻿#region "Copyright (C) Lenny Granovsky. 2011-2013"
//    This library provides extended cache capabilities to the ASP.NET applications.
//
//                Copyright (C) Lenny Granovsky. 2011-2013. 
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 2 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
//    This program comes with ABSOLUTELY NO WARRANTY.
//    This is free software, and you are welcome to redistribute it
//    under certain conditions;
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FlexiCache
{
    /// <summary>
    /// Class represents set of configuration settings for adapter instance to run.
    /// </summary>
	public class CacheStorageConfigInfo
	{
        /// <summary>
        /// Gets or sets the boolean value indicating where cache storage is enabled.
        /// </summary>
        public bool IsEnabled { get; set; }
        /// <summary>
        /// Gets or sets the database connection that should be used for this instance of cache storage.
        /// </summary>
        public string DBConnectionString { get; set; }
        /// <summary>
        /// Gets or sets the MongoDB database instance name to use for the cache.
        /// </summary>
        public string CacheDatabaseName { get; set; }
        /// <summary>
        /// Gets or sets the boolean indicator whethere MongoDB should acknowledged write: see MongoDB technical details for more info on WriteConcern.
        /// </summary>
        public bool IsAcknowledgedWrite { get; set; }
        /// <summary>
        /// Gets or sets the boolean indicator if data compression should be used when data stored in the cache.
        /// </summary>
        public bool UseCompression { get; set; }
        /// <summary>
        /// The maximum data size length to save the data. If data size increases this limit, the saving process will ignore the request. 
        /// A value of 0 means unlimited data that might cause DB raise an exception if data exceeds the DB internal limit (4Mb).
        /// </summary>
        public int MaxDataSizeLength { get; set; }
        /// <summary>
        /// Gets or sets a string used by the TRACE as a prefix when it logs the info.
        /// </summary>
        public string TracePrefix { get; set; }
        /// <summary>
        /// Gets or sets the storage adapter type that should be used.
        /// </summary>
        public Type AdapterType { get; set; }

        public CacheStorageConfigInfo()
        {
            this.CacheDatabaseName = "";
            this.TracePrefix = "";
            this.DBConnectionString = "";
        }
    }
}
